 <template>
        <swiper :options="swiperOption" ref="mySwiper">
          <!-- slides -->
          <swiper-slide v-for="(val, key) in imglist" :key = key>
            <img class="img" :src="val"/>
          </swiper-slide>
          <div  class="swiper-pagination" slot="pagination">
          </div>
        </swiper>
 </template>

<script>
  export default {
    name: 'carrousel',
    data() {
      return {
        paginationList: [1, 2, 3, 4, 5],
        imglist: [
          require('../../assets/lb-01.png'),
          require('../../assets/lb_02.png'),
          require('../../assets/lb_03.png'),
          require('../../assets/lb_04.png'),
          require('../../assets/07.png')
        ],
        swiperOption: {
          autoplay: {
            delay:3000,
            // 用户操作之后是否禁止
            disableOnInteraction:false
          },
          loop: true,
          preventLinksPropagation: false,
          pagination: {
            el: '.swiper-pagination',
            clickable: true,
            type: 'bullets'
          }
        },
      }
    },
    computed: {
      swiper() {
        return this.$refs.mySwiper.swiper
      }
    },
    mounted() {
      for (let i = 0; i < this.swiper.pagination.bullets.length; i++) {
        this.swiper.pagination.bullets[i].style.width = '15px';
      }
      // this.swiper.slideTo(1, 500, true);
    }
  }
</script>


<style scoped>
  swiper-slide{
    width: 690px;
    height: 300px;
  }
  .img{
    width: 690px;
    height: 300px;
  }
  .MyClass{
    width: 20px;
    height: 15px;
    background: red;
  }
</style>
